home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / libscsi1.zoo / LibScsi-0.01 / space.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-14  |  654 b   |  33 lines

  1. /*
  2.  * space.c - Copyright Steve Woodford, August 1993.
  3.  *
  4.  * Send 'space' command to SCSI target.
  5.  */
  6.  
  7. #include <sys/types.h>
  8. #include <sys/scsi.h>
  9. #include "libscsi.h"
  10.  
  11.  
  12. PUBLIC  short
  13. Scsi_Space(u_char id, u_long where, u_char how)
  14. {
  15.     Scsi_Cmd    sc;
  16.  
  17.     if ( id & 0xc0 )
  18.         return(-1);
  19.  
  20.     (void) _Scsi_Timeout( T_Space(id) );
  21.  
  22.     sc.sc_command = CMD(id, SZ_CMD_SPACE);
  23.     sc.sc_link    = 0;
  24.     sc.sc_z[0]    = LUN(id, (how & 0x03));
  25.     sc.sc_z[3]    = where & 0xff;
  26.     where       >>= 8;
  27.     sc.sc_z[2]    = where & 0xff;
  28.     where       >>= 8;
  29.     sc.sc_z[1]    = where & 0xff;
  30.  
  31.     return ( _Scsi_Command( DMA_READ, &sc, 0L, 0 ) );
  32. }
  33.